Add store-auth source and auto fallback to store list#7714
Conversation
89f393a to
619636c
Compare
1e3e4bc to
770846a
Compare
619636c to
7c049c1
Compare
770846a to
95d8a71
Compare
7c049c1 to
52daf1c
Compare
95d8a71 to
04f35fd
Compare
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
/snapit |
|
🫰✨ Thanks @nickwesselman! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260605172558Caution After installing, validate the version by running |
04f35fd to
065f5fa
Compare
00dce2a to
22e4f4a
Compare
c8eed6e to
aa58407
Compare
22e4f4a to
31a07f1
Compare
451e239 to
bc75901
Compare
c128517 to
9343914
Compare
a57b2f7 to
996a184
Compare
9343914 to
81229e4
Compare
04b87d7 to
b3f03fe
Compare
dd7e4fc to
d137536
Compare
b3f03fe to
6246aef
Compare
d137536 to
7e91272
Compare
6246aef to
48744ec
Compare
7e91272 to
78815d1
Compare
48744ec to
f448d62
Compare
78815d1 to
27f2765
Compare
f448d62 to
97f1e30
Compare
27f2765 to
be39f2a
Compare
97f1e30 to
d711b7b
Compare
be39f2a to
3ce15df
Compare
d711b7b to
592ab5b
Compare
3ce15df to
8fc4a79
Compare
592ab5b to
cc8b9c3
Compare
8fc4a79 to
df6e5d1
Compare
cc8b9c3 to
0d54c55
Compare
df6e5d1 to
fbc732b
Compare
0d54c55 to
ca16bf5
Compare
fbc732b to
7674c38
Compare
ca16bf5 to
ed03486
Compare
7674c38 to
1cb0d3f
Compare
ed03486 to
8d4afd4
Compare
1cb0d3f to
0c933e5
Compare
8d4afd4 to
a2cf41b
Compare
0c933e5 to
a92ad67
Compare
Adds `--from auto|organization|store-auth`. `auto` (default) prefers the Shopify organization listing and falls back to locally stored store auth when the organization can't be listed for the current CLI session. Adds the store-auth source/local-source, the discriminated result contract, and the unavailable status that drives the fallback.
a2cf41b to
541a4a4
Compare
a92ad67 to
de36466
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/common/string.d.ts@@ -102,6 +102,16 @@ export declare function formatDate(date: Date): string;
* @returns The transformed string in local system time.
*/
export declare function formatLocalDate(dateString: string): string;
+/**
+ * Formats a date as a short calendar date like "May 22, 2026" () in UTC.
+ *
+ * UTC keeps the output deterministic regardless of the machine timezone. Returns an empty string
+ * when the value cannot be parsed into a valid date.
+ *
+ * @param value - A Date, epoch milliseconds, or a date string such as an ISO 8601 timestamp.
+ * @returns The formatted date, or an empty string when the value is invalid.
+ */
+export declare function formatShortDate(value: Date | number | string): string;
/**
* Given a list of items, it returns a string with the items joined by commas and the last item joined by "and".
* All items are wrapped in double quotes.
packages/cli-kit/dist/public/common/url.d.ts@@ -28,4 +28,13 @@ export declare function extractHost(value: string | null | undefined): string |
* @param value - A URL or host string, possibly null/undefined.
* @returns The myshopify subdomain handle, or undefined when the input isn't a URL.
*/
-export declare function extractMyshopifyHandle(value: string | null | undefined): string | undefined;
\ No newline at end of file
+export declare function extractMyshopifyHandle(value: string | null | undefined): string | undefined;
+/**
+ * Extracts the leading subdomain label from a URL or host, across environments — e.g.
+ * , , or local development hosts — rather than assuming a
+ * domain.
+ *
+ * @param value - A URL or host string, possibly null/undefined.
+ * @returns The first DNS label, or undefined when no host can be extracted.
+ */
+export declare function extractSubdomain(value: string | null | undefined): string | undefined;
\ No newline at end of file
packages/cli-kit/dist/public/node/session.d.ts@@ -119,9 +119,10 @@ export declare function ensureAuthenticatedThemes(store: string, password: strin
* Ensure that we have a valid session to access the Business Platform API.
*
* @param scopes - Optional array of extra scopes to authenticate with.
+ * @param options - Optional auth behavior overrides such as .
* @returns The access token for the Business Platform API.
*/
-export declare function ensureAuthenticatedBusinessPlatform(scopes?: BusinessPlatformScope[]): Promise<string>;
+export declare function ensureAuthenticatedBusinessPlatform(scopes?: BusinessPlatformScope[], options?: EnsureAuthenticatedAdditionalOptions): Promise<string>;
/**
* Logout from Shopify.
*
|

Summary
Add the
--fromsource selector andautofallback toshopify store liston top of #7709.Demo:
Screen Recording 2026-06-05 at 11.08.13 AM.mov (uploaded via Graphite)
Closes https://github.com/shop/issues-develop/issues/22919
Scope
--from auto | organization | store-auth(defaultauto)store-authsource, backed bylistStoredStoreAuthSummaries(), rendered asSubdomain | Connected; its JSON carries onlystore+connectedAt(no user id / email)autoprefer your Shopify organization and fall back to locally stored store auth whenever the organization can't be listed for the current CLI session (not signed in, session not resolvable, reauthentication required, or any auth/network/listing error)--from organizationstrict: no fallback, original error surfacednoPromptthroughensureAuthenticatedBusinessPlatform()soautocan probe without prompting--organization-idthroughauto/organization; reject it with--from store-auth; an unknown org id is a hard error in every mode (no silent fallback)Contract
organization | store-auth; no "Business Platform" wording in the command contract or outputunavailable(original error preserved) soautoalways falls back while--from organizationrethrowsSmoke checks
store list→ falls back tostore-auth, exits 0store list --from store-auth→ local store auth table, exits 0store list --from organization→ strict, surfaces the failure